package ims;

import java.io.IOException;
import java.io.InputStream;

import org.gnome.gdk.Pixbuf;
import org.gnome.gtk.Image;

public class ImageContainer {

	public static Pixbuf getPixbuf(String imageName){
		Pixbuf pb = null;
		try {
			InputStream is = ImageContainer.class.getResourceAsStream(imageName);
			int byteLength;
			byteLength = is.available();
			byte[] data = new byte[byteLength];
			is.read(data);
			 pb = new Pixbuf(data);
			 is.close();
		} catch (IOException e) {
		}
		return pb;
	}
	public static Image getImage(String imageName){
		
		
		return new Image(getPixbuf(imageName));
	}

}
